<template>
  <a-modal v-model:visible="visible" :title="title" @cancel="closeModal">
  <h4>复制分享连接</h4>
    <a-typography-link copyable>
      {{link }}
    </a-typography-link>
    <div style="margin-bottom: 16px;"></div>
    <h4>用手机扫码查看</h4>
    <a-qrcode :value="link"  />
  </a-modal>
</template>
<script setup lang="ts">
import { ref } from 'vue'

interface Props {
  title?: string
  link?: string
}
const props=withDefaults(defineProps<Props>(), {
  title: '分享',
  link: ()=>'link: () => https://laoyujianli.com/share/yupi'
})
const visible = ref<boolean>(false)

// 关闭弹框
const closeModal = () => {
  visible.value = false
}
// 打开弹框
const openModal = () => {
  visible.value = true
}
// 暴露给父组件
defineExpose({
  openModal,
})

</script>
<style scoped lang="less"></style>
